package com.inossem.warehousestorage_inossem.request.changeStorage.chuangyou;

import android.content.Context;

import com.google.gson.Gson;
import com.inossem.warehousestorage_inossem.bean.changeStorage.chuangyou.CYChangeStorageLocationBean;
import com.inossem.warehousestorage_inossem.bean.changeStorage.chuangyou.CYChangeStoragePurchaseOrderBean;
import com.inossem.warehousestorage_inossem.constant.RequestConstant;
import com.inossem.warehousestorage_inossem.listener.GsonBeanListener;
import com.inossem.warehousestorage_inossem.listener.StringRequestListener;
import com.inossem.warehousestorage_inossem.manage.RequestManage;
import com.inossem.warehousestorage_inossem.model.StringResponse;
import com.inossem.warehousestorage_inossem.request.Request;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO
 *
 * @author 王斯宇
 * @time on 2018/3/29 16:40
 * @email siyu.wang@inossem.com
 */
public class CYChangeStorageGetLocationRequest extends Request {


    public static String request(Context context , GsonBeanListener gsonBeanListener) {
        String tag;
        String methodUrl = RequestConstant.CY_URL_CHANGE_STORAGE_GET_LOCATION;
        String url = RequestManage.getUrl(context, methodUrl);
        tag = RequestManage.getHttpsGetWithLoading(context, url, new StringRequestListener() {
            @Override
            public void onSuccess(StringResponse stringRequestResponse) {
                Gson gson = new Gson();
                CYChangeStorageLocationBean bean = gson.fromJson(stringRequestResponse.getResponseInfo(), CYChangeStorageLocationBean.class);
                excuteJsonBeanNew(context, bean,gsonBeanListener);
            }
        });
        return tag;
    }
}
